﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WarOfDev.Core.ExceptionHandling.ExceptionCodes
{
    [Serializable]
    public class ErrorCode : ErrorInformation
    {
        [NonSerialized]
        private readonly Func<string> displayTextFunc;

        public ErrorCode()
        {

        }

        public ErrorCode(int code, string message, Func<string> displayTextFunc)
            : base(code, message)
        {
            this.displayTextFunc = displayTextFunc;
        }

        public string ErrorMessage
        {
            get { return this.Message; }
        }

        public string DisplayText
        {
            get { return this.displayTextFunc(); }
        }
    }
}
